package demo.chain.inter.impl;

import demo.chain.inter.ProcessorSlot;
import lombok.Setter;

/**
 * 抽象的 processor slot, 这里实现了部分接口
 *
 * @author lihh
 */
public abstract class AbstractLinkedProcessorSlot<T> implements ProcessorSlot<T> {
  
  @Setter
  private AbstractLinkedProcessorSlot<T> next = null;
  
  @Override
  public void fireEntry() {
    if (this.next != null)
      this.next.transferNextEntry();
  }
  
  private void transferNextEntry() {
    // 执行到 下一个 entry
    this.entry();
  }
}
